
package com.mephi.interfaces;


import java.util.Map;
import com.mephi.gui.Field;
import com.mephi.gui.Piece;
import com.mephi.util.CastlingSort;
import com.mephi.util.PieceColor;
import com.mephi.util.PieceSort;

/**
 * Interface which describes action on chessboard.
 * 
 * @author mephisto
 * 2011-06-14
 */
public interface Chessboard
{
	/**
	 * 
	 * @param from the field from the Piece will be moved to set
	 * @param to the field to the Piece will be moved to set
	 */
	void movePiece(String from, String to);
	
	/**
	 * 
	 * @param from the field from the Piece will be moved to set
	 * @param to the field to the Piece will be moved to capture another Piece to set
	 */
	void capturePiece(String from, String to);
	
	/**
	 * 
	 * @param from the field from the Piece will be moved to set
	 * @param to the field to the Piece will be moved to set
	 * @param pieceSort the PieceSort to which pawn will be promoted 
	 */
	void promotePawn(String from, String to, PieceSort pieceSort);
	
	/**
	 * 
	 * @param piece the piece to set
	 * @param field the field on which piece will be displayed
	 */
	void setPiece(Piece piece, String field);
	
	/**
	 * 
	 * @param field the field to set
	 * @return the Piece on the field or null if there is no Piece
	 */
	Piece getPiece(String field);
	
	/**
	 * 
	 * Removes Piece from field indicates by field.
	 * 
	 * @param field the field from which Piece will be removed
	 */
	void removePiece(String field);
	
	/**
	 * Makes long or short castling.
	 * 
	 * @param pieceColor the pieceColor to set
	 * @param castlingSort the castlingSort to set
	 */
	void makeCastling(PieceColor pieceColor, CastlingSort castlingSort);
	
	/**
	 * 
	 * Clears the chessboard. 
	 */
	void clearChessboard();
	
	/**
	 * 
	 * Sets the starting position.
	 */
	void setStartingPosition();
	
	/**
	 * Returns the map with Fields which fully representing state on the chessboard. Keys are the name of fields
	 * from "a1"-a8 to "h1-h8" of the chesboard for example "a1" or "h4".
	 * 
	 * @return the map with Fields
	 */
	Map<String, Field> getChessFieldsMap();
}
